/**
 * @AUTHOR:Bogdan Blaga
 * 
 */

	function activeClick() {
		document.getElementById("updateBtn").disabled = false;
		document.getElementById("sendEmail").disabled = false;
	}
	
	function activeClickDir() {
		
		document.getElementById("activateBtn").disabled = true;
		document.getElementById("removeBtn").disabled = false;
		document.getElementById("updateBtn").disabled = false;
		document.getElementById("sendEmail").disabled = false;
	}

	function inactiveClick() {
		document.getElementById("updateBtn").disabled = true;
		document.getElementById("sendEmail").disabled = true;
	}
	
	function inactiveClickDir() {
		document.getElementById("activateBtn").disabled = false;
		document.getElementById("removeBtn").disabled = true;
		document.getElementById("updateBtn").disabled = true;
		document.getElementById("sendEmail").disabled = true;
	}

	function populateFields(row) {
		document.getElementById("idPosition").value = row.cells[0].innerHTML;
		document.getElementById("name").value = row.cells[1].innerHTML;
		document.getElementById("nrPersons").value = row.cells[2].innerHTML;
		document.getElementById("idDescription").value = row.cells[3].innerHTML;
		document.getElementById("requirements").value = row.cells[4].innerHTML;
		document.getElementById("responsabilities").value = row.cells[5].innerHTML;
		document.getElementById("project").value = row.cells[6].innerHTML;
		document.getElementById("department").text = row.cells[7].innerHTML;
		document.getElementById("idPositionStatus").value = row.cells[8].innerHTML;
		document.getElementById("department").value = row.cells[9].innerHTML;
	}

	function validate() {
		var positionName = document.getElementById("name").value;
		var nrPersons = document.getElementById("nrPersons").value;
		var requirements = document.getElementById("requirements");
		var responsabilities = document.getElementById("responsabilities");
		var project = document.getElementById("project");
		if (positionName == null || positionName == "") {
			alert(document.getElementById("emptyfilledname").name);
			document.getElementById("name").focus();
			return false;
		}
		if (nrPersons == "") {
			alert(document.getElementById("emptyfillednrpersons").name);
			document.getElementById("nrPersons").focus();
			return false;
		}

		if (requirements.value == "") {
			alert(document.getElementById("emptyfilledrequirements").name);
			document.getElementById("requirements").focus();
			return false;
		}

		if (responsabilities.value == "") {
			alert(document.getElementById("emptyfilledresponsibilities").name);
			document.getElementById("responsabilities").focus();
			return false;
		}
		if (project.value == "") {
			alert(document.getElementById("emptyfilledproject").name);
			document.getElementById("project").focus();
			return false;
		}
	}
	
	function exportFunction() {
		document.location.href="/jt-hr-WEB/PdfDownloadServlet?idPosition="+document.getElementById("idPosition").value+"&expType="+document.getElementById("expType").value;
	}
	
	
